/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package driver;

import edu.wpi.first.wpilibj.PIDSource;

/**
 *
 * @author matthew
 */
public class IMU implements PIDSource {
    
    SPI spi;
    
    public IMU(SPI spiIMU)
    {
        spi = spiIMU;
        spi.initialize();
    }
    
    public IMU(int slotParam, int clockPinParam, int dataOutPinParam, int dataInPinParam, int chipSelectPinParam)
    {
        spi = new SPI(slotParam, clockPinParam, dataOutPinParam, dataInPinParam, chipSelectPinParam);
        spi.initialize();
    }
    
    public IMU(int clockPinParam, int dataOutPinParam, int dataInPinParam, int chipSelectPinParam)
    {
        spi = new SPI(1, clockPinParam, dataOutPinParam, dataInPinParam, chipSelectPinParam);
        spi.initialize();
    }
    
    public double pidGet()
    {
        return 0.0;
    }
    
    public double getHeading()
    {
        return spi.getData().output[1];
    }
    
}
